﻿using System;
using System.Collections;

namespace RxjhServer
{
	public class OpenClass
	{
		private int _FLD_PID;

		private string _FLD_NAME;

		private int _FLD_PIDX;

		private string _FLD_NAMEX;

		private int _FLD_NUMBER;

		private int _FLD_PP;

		private int _FLD_MAGIC1;

		private int _FLD_MAGIC2;

		private int _FLD_MAGIC3;

		private int _FLD_MAGIC4;

		private int _FLD_MAGIC5;

		private int _是否提示;

		public int FLD_PID
		{
			get
			{
				return this._FLD_PID;
			}
			set
			{
				this._FLD_PID = value;
			}
		}

		public string FLD_NAME
		{
			get
			{
				return this._FLD_NAME;
			}
			set
			{
				this._FLD_NAME = value;
			}
		}

		public int FLD_PIDX
		{
			get
			{
				return this._FLD_PIDX;
			}
			set
			{
				this._FLD_PIDX = value;
			}
		}

		public string FLD_NAMEX
		{
			get
			{
				return this._FLD_NAMEX;
			}
			set
			{
				this._FLD_NAMEX = value;
			}
		}

		public int FLD_NUMBER
		{
			get
			{
				return this._FLD_NUMBER;
			}
			set
			{
				this._FLD_NUMBER = value;
			}
		}

		public int FLD_PP
		{
			get
			{
				return this._FLD_PP;
			}
			set
			{
				this._FLD_PP = value;
			}
		}

		public int FLD_MAGIC1
		{
			get
			{
				return this._FLD_MAGIC1;
			}
			set
			{
				this._FLD_MAGIC1 = value;
			}
		}

		public int FLD_MAGIC2
		{
			get
			{
				return this._FLD_MAGIC2;
			}
			set
			{
				this._FLD_MAGIC2 = value;
			}
		}

		public int FLD_MAGIC3
		{
			get
			{
				return this._FLD_MAGIC3;
			}
			set
			{
				this._FLD_MAGIC3 = value;
			}
		}

		public int FLD_MAGIC4
		{
			get
			{
				return this._FLD_MAGIC4;
			}
			set
			{
				this._FLD_MAGIC4 = value;
			}
		}

		public int FLD_MAGIC5
		{
			get
			{
				return this._FLD_MAGIC5;
			}
			set
			{
				this._FLD_MAGIC5 = value;
			}
		}

		public int 是否提示
		{
			get
			{
				return this._是否提示;
			}
			set
			{
				this._是否提示 = value;
			}
		}

		public static OpenClass GetOpen(int Pid)
		{
			ArrayList arrayList = new ArrayList();
			Random random = new Random();
			int num = random.Next(1, 5000);
			foreach (OpenClass current in World.Open)
			{
				if (current.FLD_PID == Pid && current.FLD_PP >= num)
				{
					arrayList.Add(current);
				}
			}
			if (arrayList.Count == 0)
			{
				return null;
			}
			int index = random.Next(0, arrayList.Count);
			return (OpenClass)arrayList[index];
		}
	}
}
